<?php /* Smarty version 2.6.26, created on 2013-10-26 18:28:15
         compiled from ./admin/attribute_info.html */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "../templates/admin/header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<script type="text/javascript" src="js/test.js">
</script>

<div class="main-div">
<?php if ($this->_tpl_vars['judge'] == 'add'): ?>
<form method="post" action="attributeCat.php?act=insert" name="theForm"  onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">属性名称：</td>
    <td><input type="text" name="attr_name" maxlength="60" size = "30" value="" /></td>
  </tr>
  <tr>
    <td class="label">所属商品类型：</td>
    <td>
      <select name="cat_id">
        <option value="0" selected="selected">请选择...</option>
        <?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cat']):
?>
        <option value="<?php echo $this->_tpl_vars['cat']['cat_id']; ?>
"><?php echo $this->_tpl_vars['cat']['cat_name']; ?>
</option>
        <?php endforeach; endif; unset($_from); ?>
      </select>
    </td>
  </tr>
  <tr>
    <td class="label">能否进行检索：</td>
	<td>
    <input type="radio" name="attr_index" value="0" checked="true">不需要检索
    <input type="radio" name="attr_index" value="1">关键字检索
    <input type="radio" name="attr_index" value="2">范围检索
	</td>
  </tr>
    <tr>
    <td class="label">相同属性的商品是否关联：</td>
    <td>
      <input type="radio" name="is_linked" value="0" checked="true" />否
      <input type="radio" name="is_linked" value="1"/>是
    </td>
  </tr>
  <tr>
    <td class="label">属性是否可选：</td>
    <td>
    <input type="radio" name="attr_type" value="0" checked="true" />唯一属性
    <input type="radio" name="attr_type" value="1">单选属性
    <input type="radio" name="attr_type" value="2">复选属性
    </td>
  </tr>
  <tr>
    <td class="label">该属性值得录入方式：</td>
    <td>
    <input type="radio" name="attr_input_type" value="0" checked="true" />手工录入
    <input type="radio" name="attr_input_type" value="1">从下面列表中选择（一行代表一个可选值)
    <input type="radio" name="attr_input_type" value="2">多行文本框
    </td>
  </tr>
  <tr>
    <td class="label">可选值列表</td>
    <td><textarea  name="attr_values" cols="30" rows="4"></textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><br />
      <input type="submit" class="button" value="确定" />
      <input type="reset" class="button" value="重置" />
    </td>
  </tr>
</table>
</form>
<?php endif; ?>
<?php if ($this->_tpl_vars['judge'] == 'edit'): ?>
<form method="post" action="attributeCat.php?act=update&attr_id=<?php echo $this->_tpl_vars['attr_id']; ?>
" name="theForm"  onsubmit="return validate()">
<table cellspacing="1" cellpadding="3" width="100%">
  <tr>
    <td class="label">属性名称：</td>
    <td><input type="text" name="attr_name" maxlength="60" size = "30" value="<?php echo $this->_tpl_vars['attr_row']['attr_name']; ?>
" /></td>
  </tr>
  <tr>
    <td class="label">所属商品类型：</td>
    <td>
      <select name="cat_id">
        <option value="0" selected="selected">请选择...</option>
        <?php $_from = $this->_tpl_vars['cat_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['cat']):
?>
        <option value="<?php echo $this->_tpl_vars['cat']['cat_id']; ?>
" <?php if ($this->_tpl_vars['cat']['cat_id'] == $this->_tpl_vars['cat_id']): ?>selected="selected"<?php endif; ?> ><?php echo $this->_tpl_vars['cat']['cat_name']; ?>
</option>
        <?php endforeach; endif; unset($_from); ?>
      </select>
    </td>
  </tr>
  <tr>
    <td class="label">能否进行检索：</td>
	<td>
    <input type="radio" name="attr_index" value="0" <?php if ($this->_tpl_vars['attr_row']['attr_index'] == 0): ?>checked="true"<?php endif; ?> />不需要检索
    <input type="radio" name="attr_index" value="1" <?php if ($this->_tpl_vars['attr_row']['attr_index'] == 1): ?>checked="true"<?php endif; ?> />关键字检索
    <input type="radio" name="attr_index" value="2" <?php if ($this->_tpl_vars['attr_row']['attr_index'] == 2): ?>checked="true"<?php endif; ?> />范围检索
	</td>
  </tr>
    <tr>
    <td class="label">相同属性的商品是否关联：</td>
    <td>
      <input type="radio" name="is_linked" value="0" <?php if ($this->_tpl_vars['attr_row']['is_linked'] == 0): ?>checked="true"<?php endif; ?> />否
      <input type="radio" name="is_linked" value="1" <?php if ($this->_tpl_vars['attr_row']['is_linked'] == 1): ?>checked="true"<?php endif; ?> />是
    </td>
  </tr>
  <tr>
    <td class="label">属性是否可选：</td>
    <td>
    <input type="radio" name="attr_type" value="0" <?php if ($this->_tpl_vars['attr_row']['attr_type'] == 0): ?>checked="true"<?php endif; ?> />唯一属性
    <input type="radio" name="attr_type" value="1" <?php if ($this->_tpl_vars['attr_row']['attr_type'] == 1): ?>checked="true"<?php endif; ?> />单选属性
    <input type="radio" name="attr_type" value="2" <?php if ($this->_tpl_vars['attr_row']['attr_type'] == 2): ?>checked="true"<?php endif; ?> />复选属性
    </td>
  </tr>
  <tr>
    <td class="label">该属性值得录入方式：</td>
    <td>
    <input type="radio" name="attr_input_type" value="0" <?php if ($this->_tpl_vars['attr_row']['attr_input_type'] == '手工录入'): ?>checked="true"<?php endif; ?> />手工录入
    <input type="radio" name="attr_input_type" value="1" <?php if ($this->_tpl_vars['attr_row']['attr_input_type'] == '列表中选择'): ?>checked="true"<?php endif; ?> />从下面列表中选择（一行代表一个可选值)
    <input type="radio" name="attr_input_type" value="2" <?php if ($this->_tpl_vars['attr_row']['attr_input_type'] == '多行文本框'): ?>checked="true"<?php endif; ?> />多行文本框
    </td>
  </tr>
  <tr>
    <td class="label">可选值列表</td>
    <td><textarea  name="attr_values2" cols="30" rows="4"></textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><br />
      <input type="hidden" id="attr" value="<?php echo $this->_tpl_vars['attr_row']['attr_values']; ?>
"/>
      <input type="submit" class="button" value="确定" />
      <input type="reset" class="button" value="重置" />
    </td>
  </tr>
</table>
</form>
<?php endif; ?>
</div>

</body>
</html>